//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_getslope.sqf"
#include "xr_macros.sqf"

private ["_pos", "_rad", "_centrH", "_height"];
PARAMS_2(_pos,_rad);
GVARXR(slopeObj) setPos _pos;
_centrH = getPosASL GVARXR(slopeObj) select 2;
_height = 0;
for "_dir" from 0 to 315 step 45 do {
	GVARXR(slopeObj) setPos [(_pos select 0) + ((sin _dir) * _rad), (_pos select 1) + ((cos _dir) * _rad),0];
	_height = _height + abs (_centrH - (getPosASL GVARXR(slopeObj) select 2));
};
_height / 8